home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
PROGEDIT
/
3458A.ZIP
/
AMAC44A.ZIP
/
DSIZ@1.QM
< prev
next >
Wrap
Text File
|
1992-04-26
|
6KB
|
100 lines
* dsiz@1.QM
* Written By Tom Hogshead
* [ See DSIZxx.QM For Use ]
* 4/26/92
* M A C R O
* ----------------------------------------------------------------------
* @(1) Directory Sizes Sorted by Size in Descending Order,
* RIGHT Justify Number of Files' Column
* ----------------------------------------------------------------------
* This macro lists all directories in a current or a specified drive,
* sorted by directory size in descending order. The number of files in
* each directory is also shown. The macro can be invoked only at the
* command line, not while editing, by running the batch file dsiz1.bat
* which must be in the path or current directory.
* SYNTAX: dsiz1 [drive:] <enter>
* After the directory list is saved as [drive:]\dsiz.lst and loaded for
* viewing, the temporary file c:\dsiz.ls (no "t" extension) is deleted.
* Macro @1 differs from @2 in that it RIGHT justifies the number of
* files' column.
* Output of dsiz1.bat on my G: drive with @1: Note
* ------------------------------------------- RIGHT Justification
* Volume [G:MINISCRB_2] created: 92-Jan-20 14:34:16; vvv
* Directory of [g:\qpro\] 2,214,991 bytes in 54 files
* Directory of [g:\nu\] 1,882,085 bytes in 45 files
* Directory of [g:\qe\] 1,400,421 bytes in 81 files
* Directory of [g:\pcplus\] 1,319,337 bytes in 158 files
* Directory of [g:\slmr\] 301,762 bytes in 15 files
* < Lines omitted >
* Directory of [g:\dos\] 166,684 bytes in 19 files
* Directory of [g:\pckwik\] 118,310 bytes in 13 files
* Directory of [g:\] 2,043 bytes in 1 file
* Directory of [g:\ibm\] 0 bytes in 1 file
* 14,310,447 bytes in 1,368 files. 15,069,184 bytes allocated (5% slack).
* Contents of dsiz1.bat using @1 in dsiz@1.qm are:
* ┌───────────────────────────────────────────────────────────────────────┐
* │: dsiz1.bat 4/23/92 │
* │: To run this batch file anywhere, change "Edsiz@1.mac" to: │
* │: "E[d:\path\]dsiz@1.mac" │
* │: where [d:\path\] is [drive:\directory\] for dsiz@1.mac location.│
* │: %1 = Drive with colon. Uses current drive if %1 is not specified. │
* │: Requires DX.EXE (Directory Extended) and Q.EXE in path. │
* │: Change c:\ to desired dsiz.ls location, preferably a ram drive. │
* │ │
* │ @echo off │
* │ cls │
* │ DX.EXE %1\ //t/st:1/he:1/at:hsd-/ff/ca:l/out:c:\dsiz.ls │
* │ Q.EXE c:\dsiz.ls /Edsiz@1.mac │
* └───────────────────────────────────────────────────────────────────────┘
@1 macrobegin setscreenoff savesettings setinsmode
setwordwrapmode togglewordwrap cursordown
* --------- Move Directory Size To Line With Directory Name ---------*
JOINLINE: cursordown jfalse AT_EOF
delline unmarkblock markcolumn endline
delltword delltword delltword delltword markcolumn
cursorup gotocolumn "50" return moveblock
* ------------------- Delete Blank Lines After Move ------------------*
cursordown delline delline
AT_EOF: begline jtrue JOINLINE
* ----------------- Mark Size Block For Descend Sort -----------------*
begfile cursordown gotocolumn return markcolumn
* ------------- Descend Sort By Size (From @4 in rfr009.qm) ----------*
sort
AGAIN: gotoblockend jfalse DELMARK delline
gotoblockbeg unkill jump AGAIN
DELMARK: markcolumn wordleft wordleft
TO_TOP: pageup jtrue TO_TOP markcolumn
* ----------- Change "file " to "file*" To Line Up Column ----------*
findreplace "file" return "file*" return "LNW" return
* ------ Make Column Block Of Widest Line (From @7 mis003.qm) -------*
editfile "nul" return copyblock
unmarkblock markcolumn
1: endline cursorleft markcolumn cursordown jtrue 1
* ---------- Right Justify Column Block (From @1 rfr004.qm) ----------*
gotoblockend cursorleft addline #173 cursorup
LOOP: unmarkblock markcolumn endline
cut begline paste endline jtrue EMPTY gotoblockend
EMPTY: cursorleft cursorup jtrue LOOP begfile cursorright
markcolumn endfile cursorup
copy quit pasteover
* -------------------- Remove's "*" From "file*" ---------------------*
findreplace "*" return " " return "LN" return
* ------------------ Save File To Drive And Cleanup ------------------*
begfile wordright markword copy * Copy drive letter
writeblock
paste ":\dsiz.lst" return * Write file to [d:]\dsiz.lst
"o" * In case [d:]\dsiz.lst exists
editfile return * Load [d:]\dsiz.lst
nextfile killfile quit * Kill/quit c:\dsiz.ls
restoresettings
*
* 185 bytes Sun 04-26-1992 14:43:30 (TH @1)